Trying to compile this code:
#!perl
use strict;
use warnings;
use 5.020;
my @Org = (9, 1,0);
my $N= #Org;
say "N = $N";
say @Org;
But getting this error:
Glob...
I think you (IIRC) found the sweet spot that works well the vast majority of the time. Having said that I remain sceptical of the latest 'smart' autocomplete. [https://www.jwz.org/blog/2023/03/ai-i...
my $N= #Org; ... seen this kind of error many times in my programs
If you find you make this sort of error frequently then it would probably be worth ena...
> my $N = scalar( @Org );
That's explicit and correct, tho for completeness
my $N = @Org;
Has the same implicit effect, since it's a scalar assignment...
Others already told you how to do right...
... But you asked:
> What do I do wrong?
Point is, that # "normally" starts a comment, and you wrote
my $N= #...